
<?php

include 'source/config.php';
include 'source/soap.fnc.php';

?>


<!DOCTYPE html>
<html>
<head>
<title>浙江联通淘号吧-订单信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link href="css/unicom.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- 遮罩层或隐藏层 -->
		<div id="fade" class="info_black"></div>
<!-- 订单详情 -->
		<div id="address_dingdan" class="white_content3">
			<div class="address_div1"><img src="images/tishi_05.png" class="address_tishi"/>提示</div>
			<div>
				<ul class="address_ul">
					<li>
						<div class="address_divL">购买号码：</div>
						<div class="address_divR" id="add-pro"><?php echo $phone_code;?> </div>
					</li>
					<li>
						<div class="address_divL">机主姓名：</div>
						<div class="address_divR" id="add-name"><?php echo $name;?></div>
					</li>
					<li>
						<div class="address_divL">身份证：</div>
						<div class="address_divR" id="add-id"><?php echo $sfcode;?></div>
					</li>
					<li>
						<div class="address_divL">收货人姓名：</div>
						<div class="address_divR" id="add-adname"></div>
					</li>
					<li>
						<div class="address_divL">地址：</div>
						<div class="address_divR" id="add-address"></div>
					</li>
					<li>
						<div class="address_divL">联系方式：</div>
						<div class="address_divR" id="add-admobile"></div>
					</li>
					<li>
						<div class="address_divL">支付方式：</div>
						<div class="address_divR" id="add-adpay">货到付款(现金支付)</div>
					</li>
					<li>
						<div class="address_divL">共需支付：</div>
						<div class="address_divR" id="add-adpayment">￥<span class="add-adpays-fco"><?php echo $price;?></span></div>
					</li>
				</ul>
			</div>
			<div class="address-btns">
					<a href="javascript:void(0)"><div class="address-btn-l">确定</div></a>
					<a href="javascript:void(0)"><div class="address-btn-r address-choice-ad">取消</div></a>
			</div>
		</div>
<!-- content 320 -->
<div class="uni_info3">
		<!-- header 100% -->
		<div class="header">
			<img src="images/banner_02.jpg" alt="logo" class="logo_style">
			<a href="javascript:history.back();"><div class="header_divA"></div></a>
		</div>
		<!-- content -->
		<div class="content">
			<p class="font_3">请填写送货信息<span class="color_adjust">（配送地址仅限浙江省内）</span></p>
			<div class="order_divs">
				<div class="order_divl">
					<span>姓名：<input type="text" value="<?php echo $name;?>" placeholder="<?php echo $name;?>" class="inp01" readonly="readonly" id="name1" maxlength="10"/></span>
				</div>
				<div class="order_divr">
					<span class="button_yuan obutton_info" id="changeBtn">修改</span>
				</div>
				<!--<p class="font_3"><span class="color_adjust">姓名：<span id="name1">eric.chen</span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="display:none;">情侣姓名：<span id="name2"></span></span></p>-->
			</div>
			<div class="button_yuan button_margin2 content_div adCol1">手机号码(必填)<input name="tel" id="tel" maxLength="11" class="input_style"></div>
			<div class="order_douNum">
				<div class="button_yuan button_margin2 content_div adCol1 fl_l">区号<input maxLength="4" name="phonecode" id="phonecode" class="input_l"></div>
				<div class="button_yuan button_margin2 content_div adCol1 fl_r order_div2">座机号码<input maxLength="8" name="phone" id="phone" class="input_r"></div>
				<div class="order_div3">+</div>
			</div>
			<div class="button_yuan button_margin2 content_div adCol1">送货地址(必填)<input name="addr" id="addr" maxLength="100" class="input_style"></div>
			<div class="button_yuan button_margin2 content_div adCol1">邮编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="zip" id="zip" maxLength="6" class="input_style"></div>
		</div>
		<!-- footers -->
		<div class="gtspDiv">
			<!--			<div class="emstype"><span class="color_adjust">使用支付宝完成购买额外赠送2.4G流量，流量次月起分12个月返还</span></div>
						<div class="gotoshipping2L">
				<a href="javascript:void(0)"><div class="info-col-ad1" onClick="goto_next(1);">支付宝付款</div></a>
			</div>-->
			<div class="gotoshipping2R">
				<a href="javascript:void(0)"><div class="info-col-ad2" onClick="goto_next(0);">货到付款</div></a>
			</div>
		</div>
<!-- 导航栏 -->
	<div class="allBottoms">
			&nbsp;
		</div>
	</div>
	<!-- 所有页面导航 -->
		<div class="footNav">
		<div class="footNav-s">
			<div class="footNav-div1">
				<div class="footNav-div1-d">
					<img src="images/qietu_36.png" class="footNav-div1-img"/>
				</div>
			</div>
			<div class="footNav-div2">
				<div style="overflow:auto;">
				<!-- 左浮动 -->
				<a href="shoujiguan.php?uid=1&domain=itsabutterfly.com&appkey=">
				<div class="footNav-div2-dl">
					<div class="footNav-div2-dld">手机馆</div>
				</div>
				</a>
				<!-- 右浮动 -->
				<a href="javascript:void(0)">
				<div class="footNav-div2-dr">
					<div class="footNav-div2-drd">关注微信</div>
				</div>
				</a>
				<!-- 居中 -->
				<a href="shop.php?uid=1&domain=itsabutterfly.com&appkey=">
				<div class="footNav-div2-dm">
					<div class="footNav-div2-dmd">淘号吧</div>
				</div>
				</a>
				</div>
				<div class="LTDivLine"></div>
				<div class="unicomQQ">
					联通QQ:1031665132
				</div>
			</div>
			</div>
		</div>
<!-- 遮罩层或隐藏层 -->
	<div id="navWX-b" class="navWX-b"></div>
	<!-- 弹出层 -->
	<div id="navWX-w" class="navWX-w">
		<div class="navWX-wD">
			<div class="navWX-wD-d1">
				<img src="images/qietu_25.jpg" class="navWX-wD-d1-img"/>
			</div>
			<div class="navWXAdF">1，您可以扫上面的二维码 </div>
			<div class="navWXAdF">2，您也可以在微信内搜索“浙江联通网上商城”微信公众号，关注浙江联通微信，体验更多互动功能 </div>
		</div>
		<div class="navBtnQ">取消</div>
	</div>
</body>
</html>
<script type="text/javascript" src="js/jquery-1.9.1.min.js" ></script>
<script type="text/javascript" src="js/ipChoice.js" charset="utf-8"></script>
<script>
//下一步
function goto_next(paytype)
{
	var type = 4;
	if(escape($("#name1").val()).indexOf("%u")<0 && $("#name1").val().search(/[a-zA-Z]+/)==-1)
	{
		Uconfirm("请填写正确姓名");
		//$("#name1").focus();
		return false;
	}
	if($("#tel").val() == "" && $("#phone").val() == "")
	{
		Uconfirm("请填写正确号码");
		//$("#tel").focus();
		return false;
	}
	else
	{
		if(!(/^1[3|5|8][0-9]\d{8}$/.test($("#tel").val())))
		{
			//if($("#phone").val().length < 7 || $("#phonecode").val().length < 3 || isNaN($("#phone").val()) || isNaN($("#phonecode").val()))
			{
				Uconfirm("请填写正确手机号码");
				//$("#phone").focus();
				return false;
			}
		}
	}
	var phone = $("#phonecode").val()+"-"+$("#phone").val();//区号加电话
	if($("#addr").val() == "")
	{
		Uconfirm("请输入送货地址");
		//$("#addr").focus();
		return false;
	}
	var name = $("#name1").val();
	if(paytype == 1)
	{
		$.getJSON("ajax/add_order_pay.php",{type:4,uid:1,name:name,name2:''
		,sfcode:'453111111111111111',sfcode2:'',coupon:0,pa:8		,price:8000,phone_code:'18668263333',phone_code2:''
		,bc:0,tel:$("#tel").val(),addr:$("#addr").val(),zip:$("#zip").val(),phone:phone,area:'宁波'
		,uuid:'d6ff84ca2d4046299ab7ac049d5f91df',mobileId:'18668263333',uuid2:'',mobileId2:'',domain:'itsabutterfly.com'},
		function (json){
			if(json.err == "1")
			{
				Uconfirm2(json.errinfo);
				return false;
			}
			else
			{
				//Uconfirm(json.errinfo);
				//location.href='shop.php';
				location.href='paypal2/alipayto.php?o='+json.out_trade_no+'&s='+json.subject+'&p='+json.total_fee+'&u='+json.out_user+'&k='+json.key;
			}
		});
		//location.href='http://www.itsabutterfly.com/liantong2/paypal/alipayto.php?o=WX90004&s=13109099999&p=0.01&u=310000000000000000&k=08acc2dfd79925b14eb5579e8a18907a';
	}
	else
	{
		
		$("#add-adname").html($("#name1").val());
		$("#add-address").html($("#addr").val());
		$("#add-admobile").html($("#tel").val());
		$('#fade').show();
		$('#address_dingdan').show();
		
		/*$.getJSON("ajax/add_order.php",{type:4,uid:1,name:name,name2:''
		,sfcode:'453111111111111111',sfcode2:'',coupon:0,pa:8		,price:8000,phone_code:'18668263333',phone_code2:''
		,bc:0,tel:$("#tel").val(),addr:$("#addr").val(),zip:$("#zip").val(),phone:phone,area:'宁波'
		,uuid:'d6ff84ca2d4046299ab7ac049d5f91df',mobileId:'18668263333',uuid2:'',mobileId2:'',domain:'itsabutterfly.com',appkey:''},
		function (json){
			if(json.err == "1")
			{
				Uconfirm(json.errinfo);
				return false;
			}
			else
			{
				//Uconfirm(json.errinfo);
				//location.href='shop.php';
				location.href='success.php?uid=1&oid='+json.oid+'&type='+json.phone_grade+'&aprice='+json.price+'&pa=8&price=8000&phone_code=18668263333&phone_code2=&area=宁波';
			}
		});*/
	}
}
$('#changeBtn').click(
function(){
	var cont = $('#changeBtn').html();
	if( cont == "修改"){
		$("#name1").removeAttr("readonly");
		//$("#name1").focus();
		$('#changeBtn').html("确定");
	}else if( cont == "确定"){
		if(escape($("#name1").val()).indexOf("%u")<0 && $("#name1").val().search(/[a-zA-Z]+/)==-1)
		{
			Uconfirm("请填写正确姓名");
			//$("#name1").focus();
			return false;
		}
		$("#name1").attr("readonly", "readonly");
		//$("#name1").focus();
		$('#changeBtn').html("修改");
	}
}
);

$('.address-btns .address-btn-r').click(
				function(){
					$('#fade').hide();
					$('#address_dingdan').hide();
				}
			);
			
$('.address-btn-l').click(
				function(){
					var phone = $("#phonecode").val()+"-"+$("#phone").val();//区号加电话
					var name = $("#name1").val();
	$.getJSON("ajax/orderMobile.php",{type:4,uid:1,name:name,name2:''
		,sfcode:'<?php echo $sfcode;?>',sfcode2:'',coupon:0,pa:<?php echo $pa;?>,price:8000,phone_code:'<?php echo $phone_code;?>',phone_code2:''
		,bc:<?php echo $bc;?>,tel:$("#tel").val(),addr:$("#addr").val(),zip:$("#zip").val(),phone:phone,area:'<?php echo $area;?>'
		,uuid:'<?php echo $uuid;?>',mobileId:'18668263333',uuid2:'',mobileId2:'',domain:'itsabutterfly.com',appkey:''},
		function (json){
			if(json.err == "1")
			{
				
				Uconfirm(json.errinfo);
				return false;
			}
			else
			{
				//Uconfirm(json.errinfo);
				//location.href='shop.php';
				location.href='success.php?uid=1&oid='+json.oid+'&type='+json.phone_grade+'&aprice='+json.price+'&pa=8&price=8000&phone_code=<?php echo $phone_code;?>&phone_code2=&area=<?php echo $area;?>';
			}
		});
					
					
				}
			);
</script>